package tech.yunjing.train.service;


import tech.yunjing.train.entity.SmallRedPacket;
import tech.yunjing.train.service.exception.*;

import java.util.List;

/**
 * 抢红包的接口，该接口定义了有关抢红包的方法
 * Created by zlc on 2017/6/8.
 */
public interface ReceiveRedPacketService {

    /**
     * 抢红包方法
     *
     * @param redPacketName
     * @return 用户抢到的红包金额
     */
    Double receiveMoney(String redPacketName, String userAccount, String receiveAccount) throws SmallRedPacketNumberException,UserLoginException;

    /**
     * 根据用户账户和大红包名称查找所有的小红包
     *
     * @param redPacketName
     * @return 查询到的小红包集合
     */
    List<SmallRedPacket> findAll(String redPacketName, String userAccount) throws RedPacketNameException, UserAccountException, SmallRedPacketNotFountException,UserLoginException;

    /**
     * 根据用户账户和大红包名称逻辑删除小红包
     *
     * @param redPacketName 大红包名称
     * @param userAccount   用户账户
     * @return 逻辑删除的数量
     */
    int removeSmallRedPacket(String redPacketName, String userAccount) throws RedPacketNameException, UserAccountException, SmallRedPacketDeleteException,UserLoginException;
}
